/*
 * Copyright (c) Huawei Technologies Co.,Ltd. 2023. All rights reserved.
 */
package org.opengauss.test;

import com.hybench.load.DataImport;
import com.hybench.load.DataImportFactory;
import org.junit.Assert;
import org.junit.Test;

/**
 * Title: the TestDataImport class.
 * <p>
 * Description:
 *
 * @author justbk
 * @version [Tools 0.0.1, 2024/11/5]
 * @since 2024/11/5
 */
public class TestDataImport {
    public static String ogDataType = "openGauss";
    public static String notOgDataType = "not_openGauss";
    
    @Test
    public void testOne() {
        DataImport dataImport = DataImportFactory.loadDataImport(ogDataType);
        System.out.println("we find data import is " + dataImport);
        Assert.assertNotEquals(dataImport, null);
    }
    
    @Test
    public void testTwo() {
        DataImport dataImport = DataImportFactory.loadDataImport(notOgDataType);
        System.out.println("we find data import is " + dataImport);
        Assert.assertEquals(dataImport, null);
    }
    
    @Test
    public void test3() {
        DataImport dataImport = DataImportFactory.loadDataImport(ogDataType);
        System.out.println("we find data import is " + dataImport);
        Assert.assertEquals(dataImport, null);
        boolean needImport = dataImport.needImport();
        System.out.println("we find data import is " + needImport);
        Assert.assertTrue(needImport);
    }
    
    @Test
    public void test4() {
        DataImport dataImport = DataImportFactory.loadDataImport(ogDataType);
        System.out.println("we find data import is " + dataImport);
        Assert.assertEquals(dataImport, null);
        boolean needImport = dataImport.needImport();
        System.out.println("we find data import is " + needImport);
        Assert.assertTrue(needImport);
        String dataType = dataImport.getDbType();
        System.out.println("we find data import type is " + needImport);
        Assert.assertEquals(dataType, ogDataType);
    }
}
